package com.yan.community.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yan.club.result.Result;
import com.yan.community.mapper.ClubCommunityDetailMapper;
import com.yan.community.model.ClubCommunityDetail;
import com.yan.community.service.CommunityDetailService;

/**
 * @author 彦
 * @since 2024/1/15 15:52
 */
@Service
public class CommunityDetailServiceImpl implements CommunityDetailService {

    @Resource
    private ClubCommunityDetailMapper clubCommunityDetailMapper;


    /**
     * 根据id查单个社团信息
     * 该方法用于每个社团负责人查询自己的社团信息
     *
     * @param id
     * @return
     */
    @Override
    public Result<ClubCommunityDetail> getCommunityDetailById(Long id) {
        // 判断有没有传值 如果没有传值则说明是社团负责人登录的 传值是超级管理员跳转的
        if (id == 0) {
            //todo 从线程中获取
//            id =
        }

        // 先查出基本信息
        ClubCommunityDetail clubCommunityDetail = clubCommunityDetailMapper.selectByPrimaryKey(id);

        return Result.success(clubCommunityDetail);
    }
}
